package com.zyp.boot10.controller;

import com.zyp.boot10.entity.Student;
import com.zyp.boot10.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student/")
public class StudentController {

    @Autowired
    StudentMapper mapper;

    @RequestMapping("selectByCid")
    public List<Student> selectByCid(int id) {
        return mapper.selectByCid(id);
    }
    @RequestMapping("insert")
    public void insert(@RequestBody Student s) {
        mapper.insert(s);
    }
    @RequestMapping("delete")
    public void deleteById(int id) {
        mapper.deleteById(id);
    }
}
